package cz.muni.fi.pa165.musiclibrary.api.service.auth;

/**
 * Authentication and authorization service.
 * 
 * @author Maros Kucbel
 * @date 2013-01-22T18:33:55+0100
 */
public interface IAuthService {
    /**
     * Log in user with provided credentials.
     * @param userName User name.
     * @param password User password.
     * @throws AuthException 
     */
    IUser login(String userName, String password) throws AuthException;
    
    /**
     * Logs out user.
     * @param userName User name.
     * @throws AuthException 
     */
    void logout(String userName) throws AuthException;
    
    /**
     * Checks whether user is authorized.
     * @param userName User name.
     * @return {@code true} if user is authorized, {@code false} otherwise.
     * @throws AuthException 
     */
    boolean isAuthorized(String userName) throws AuthException;
}
